package collision;

public class Shootable extends Thing {


   // private int x;
   // private int y;
    private int dx;
    private int dy;    

    /**
     * Shootable Constructor
     *
     * @param  px  			initial position x
     * @param  py  			initial position y
     * @param  imageName 	The name or file path of the image this object displays
     */
    public Shootable(int px, int py, String imageName) {
    	super(px, py, imageName);
        dx = 1;

    }

    /**
     * Shootable Constructor
     *
     * @param  px  			initial position x
     * @param  py  			initial position y
     * @param  imageName 	The name or file path of the image this object displays
     */
    public Shootable(int px, int py, int speed, String imageName) {
    	super(px, py, imageName);
        dx = speed;

    }

    /**
     * Overwrites the Thing move method to include speed and velocity.
     * This method is run for each frame of the game.
     */
    public void move() {
       int x =super.getX();
       int y =super.getY();
    	
    	if (x < 0) 
            x = 1000;
        x -= dx;
        y += dy;
        super.setPosition(x, y);
    }
    
    /**
     * Set the x velocity in pixels per frame of this Stootable object
     * 
     * @param s		the speed of this object in the x direction.
     */
    public void setDX(int s)
    {
    	dx = s;
    }

    /**
     * Get the x velocity in pixels per frame of this Stootable object
     * 
     * @return 	the speed of this object in the x direction.
     */
    public int getDX() {
        return dx;
    }
    
    /**
     * Get the y velocity in pixels per frame of this Stootable object
     * 
     * @return 	the speed of this object in the y direction.
     */
    public int getDY() {
        return dy;
    }
    

}
